import java.util.Scanner;

/**
 * Created With IntelliJ IDEA
 * Description:牛客网:WY3 小易的升级之路
 * <a href="https://www.nowcoder.com/practice/fe6c73cb899c4fe1bdd773f8d3b42c3d?tpId=49&&tqId=29329&rp=1&ru=/activity/oj&qru=/ta/2016test/question-ranking">...</a>
 * User: DELL
 * Data: 2023-04-18
 * Time: 13:41
 */


public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int ability = scanner.nextInt();
            while (n-- != 0) {
                int temp = scanner.nextInt();
                if (temp <= ability) {
                    ability += temp;
                } else {
                    ability += gcd(ability, temp);
                }
            }
            System.out.println(ability);
        }
    }

    private static int gcd (int n1, int n2) {
        while (n1 % n2 != 0) {
            int temp = n1 % n2;
            n1 = n2;
            n2 = temp;
        }
        return n2;
    }
}